<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		// 标签属性：特定属性直接操作，非特定属性用函数
		window.onload= function () {
			img = document.getElementById('img');

			// img.name img.src  img.id

			data = img.getAttribute('xbs');

			img.setAttribute('xbs','xuebingsi');

			// alert(data)
		}

	</script>
</head>
<body>
	<img id="img" xbs="888" name="xuebingsi" src="./img.png">
</body>
</html>